package com.teamclub.app.scontrollers.systemmanager

import com.teamclub.app.sforms.AppDomainInstanceForm
import com.teamclub.app.sservices.systemmanager.AppDomainInstanceService
import com.teamclub.util.libs.Eithers
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.web.bind.annotation.{PostMapping, RequestBody, RequestMapping, RestController}

/**
  * Created by ilkkzm on 17-8-16.
  */
@RestController("com.teamclub.app.scontrollers.systemmanager.AppDomainInstanceController")
@RequestMapping(Array("/app/systemmanager"))
class AppDomainInstanceController {
  @Autowired
  var appDomainInstanceService: AppDomainInstanceService = _

  @PostMapping(Array("appinstancelist"))
  def list(@RequestBody form: AppDomainInstanceForm) = {
    Eithers.toJson(appDomainInstanceService.list(form))
  }
  @PostMapping(Array("appinstanceadd"))
  def add(@RequestBody form: AppDomainInstanceForm) = {
    Eithers.toJson(appDomainInstanceService.add(form))
  }
  @PostMapping(Array("appinstancedel"))
  def del(@RequestBody form: AppDomainInstanceForm) = {
    Eithers.toJson(appDomainInstanceService.del(form))
  }
}
